/*
 * PieceFactory.java
 * Used to determine which Piece type object to return based on one specified
 */
package shogi.pieces;

/**
 *
 * @author louis
 */
public class PieceFactory {

    private PieceFactory() {
        super();
    }

    public static Piece getShogiPieceInstance(int index, char type, String orientation) {

        if (type == 'b') {
            return new BishopPiece(index, orientation);
        } else if (type == 'g') {
            return new GoldPiece(index, orientation);
        } else if (type == 'k') {
            return new KingPiece(index, orientation);
        } else if (type == 'l') {
            return new LancePiece(index, orientation);
        } else if (type == 'p') {
            return new PawnPiece(index, orientation);
        } else if (type == 'n') {
            return new KnightPiece(index, orientation);
        } else if (type == 'r') {
            return new RookPiece(index, orientation);
        } else if (type == 's') {
            return new SilverPiece(index, orientation);
        }
        return null;
    }
}
